package com.wbs.service.error;

import com.wbs.service.canonical.ErrorResponseBean;



/**Class that represent Duplicate Value Exception*/
public class DuplicateValueException extends RuntimeException {
	
	private static final long serialVersionUID = 1L;
	
	/**Represent error response*/
	private ErrorResponseBean errorResponseBean;
	
	/**Constructor*/
	public DuplicateValueException(String message){
		super(message);
		this.errorResponseBean = new ErrorResponseBean("Duplicity Error", message);
	}
	
	/**Constructor*/
	public DuplicateValueException(String message, ErrorResponseBean errorResponseBean){
		super(message);
		this.errorResponseBean = errorResponseBean;
	}

	/**Method to get error response*/	
	public ErrorResponseBean getErrorResponseBean() {
		return errorResponseBean;
	}
	
}
